package fr.labri.macchiato.framework.business.service;

import java.util.List;

import fr.labri.macchiato.framework.business.finder.BusinessEntityFinder;
import fr.labri.macchiato.framework.business.finder.Callback;
import fr.labri.macchiato.framework.business.model.businessEntity.BusinessEntity;

/**
 * Retrieves and updates the data from the database
 * 
 * @author Michelle AVOMO
 * 
 */
public class BusinessEntityService {

	private BusinessEntityFinder finder;

	/**
	 * Default constructor
	 */
	public BusinessEntityService() {

	}

	/**
	 * Constructor with an object that finds the business entities match in the
	 * database
	 * 
	 * @param finder
	 */
	public BusinessEntityService(BusinessEntityFinder finder) {
		this.finder = finder;

	}

	/**
	 * 
	 * 
	 * @param callback
	 *            : list of the details page and infos for each b.i
	 */
	public void getDetailsBusinessEntities(
			Callback<List<BusinessEntity>> callback) {

		finder.getAllInfosOfEntities(callback);
	}

	/**
	 * 
	 * @param field
	 *            : business entity to be updated
	 */
	public void updateBusinessEntity(String field) {
		// TODO: updating values in the database if changed . That assumes that
		// we an administration module for the database.
	}

}
